From: Ian Campbell Date: Thu, 10 Oct 2013 14:43:44 +0000 (+0100) Subject: xen: arm: correctly round down MFN to 1GB boundary make sure pagetable mask macros... X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6129 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=80a7e7eaa177af948b1f4cc954bf2d39ee182724;p=xen.git xen: arm: correctly round down MFN to 1GB boundary make sure pagetable mask macros as physaddr size ~FIRST_MASK is nothing like correct for rounding down an MFN. It is the inverse *and* an address not a framenumber so wrong in every dimension! We cannot use FIRST_MASK since that would mask off any zeroeth level bits. Instead calculate the correct value from FIRST_SIZE. Signed-off-by: Ian Campbell Acked-by: Julien Grall --- diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 1773ffe3b5..123280e826 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -639,7 +639,7 @@ void __init setup_xenheap_mappings(unsigned long base_mfn, end_mfn = base_mfn + nr_mfns; /* Align to previous 1GB boundary */ - base_mfn &= ~FIRST_MASK; + base_mfn &= ~((FIRST_SIZE>>PAGE_SHIFT)-1); offset = base_mfn - xenheap_mfn_start; vaddr = DIRECTMAP_VIRT_START + offset*PAGE_SIZE;